//
//  ChangePhoneController.m
//  DYLYJ
//
//  Created by JM on 15/11/23.
//  Copyright © 2015年 JM. All rights reserved.
//

#import "ChangePhoneController.h"
#import "RegisterSecurityCodeVC2.h"
#import "DYUIKit.h"
#import "NSString-Helper.h"
@interface ChangePhoneController ()
@property(nonatomic,strong)IBOutlet UITextField *phoneTextField ;
@end

@implementation ChangePhoneController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;
    
    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

- (IBAction)clickNextBtn:(UIButton *)sender{
    [self.view endEditing:YES];
    if (self.phoneTextField.text.length == 0) {
        [MJAlertView showMessage:@"请输入新手机号"];
        return;
    }
    if (![NSString isPhoneNumber:self.phoneTextField.text]) {
        [MJAlertView showMessage:@"手机号格式非法"];
        return;
    }
    UIStoryboard* storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
    RegisterSecurityCodeVC2* vc = [storyboard instantiateViewControllerWithIdentifier:@"RegisterSecurityCodeVC2"];
    vc.name = self.phoneTextField.text;
    [self.navigationController pushViewController:vc animated:YES];
}

@end
